package org.infodavid.common.persistence;

import java.beans.PropertyChangeEvent;
import java.io.Serializable;

import org.joda.time.DateTime;

/**
 * The Interface IDataObject.
 * @param <K> the key type
 */
public interface IDataObject<K extends Serializable> extends IBasicDataObject, IPersistentData<K> {

  /** The ARCHIVED. */
  String ARCHIVED = "archived";

  /** The CREATIO n_ date. */
  String CREATION_DATE = "creationDate";

  /** The MODIFICATIO n_ date. */
  String MODIFICATION_DATE = "modificationDate";

  /** The KEY. */
  String KEY = "key";

  /**
   * Gets the creation date.
   * @return the creation date
   */
  DateTime getCreationDate();

  /**
   * Sets the creation date.
   * @param value the new creation date
   */
  void setCreationDate(DateTime value);

  /**
   * Gets the modification date.
   * @return the modification date
   */
  DateTime getModificationDate();

  /**
   * Sets the modification date.
   * @param value the modification date
   */
  void setModificationDate(DateTime value);

  /**
   * Checks if is archived.
   * @return true, if checks if is archived
   */
  boolean isArchived();

  /**
   * Sets the archived.
   * @param flag the flag
   */
  void setArchived(boolean flag);

  /**
   * Gets the key.
   * @return the key
   */
  @Override
  K getKey();

  /**
   * Sets the key.
   * @param key the key
   */
  void setKey(K key);

  /**
   * Mark modified.
   * @param evt the property change event
   */
  void markModified(PropertyChangeEvent evt);

  /**
   * Mark modified.
   * @param property the property
   * @param oldValue the old value
   * @param newValue the new value
   */
  void markModified(String property, Object oldValue, Object newValue);
}
